package model;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Tgoodtypes entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tgoodtypes", catalog = "test", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class Tgoodtypes implements java.io.Serializable {

	// Fields

	private String id;
	private Tgoodtypes tgoodtypes;
	private String name;
	private Set<Tgood> tgoods = new HashSet<Tgood>(0);
	private Set<Tgoodtypes> tgoodtypeses = new HashSet<Tgoodtypes>(0);

	// Constructors

	/** default constructor */
	public Tgoodtypes() {
	}

	/** minimal constructor */
	public Tgoodtypes(String id) {
		this.id = id;
	}

	/** full constructor */
	public Tgoodtypes(String id, Tgoodtypes tgoodtypes, String name, Set<Tgood> tgoods, Set<Tgoodtypes> tgoodtypeses) {
		this.id = id;
		this.tgoodtypes = tgoodtypes;
		this.name = name;
		this.tgoods = tgoods;
		this.tgoodtypeses = tgoodtypeses;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pid")
	public Tgoodtypes getTgoodtypes() {
		return this.tgoodtypes;
	}

	public void setTgoodtypes(Tgoodtypes tgoodtypes) {
		this.tgoodtypes = tgoodtypes;
	}

	@Column(name = "name", unique = true)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tgoodtypes")
	public Set<Tgood> getTgoods() {
		return this.tgoods;
	}

	public void setTgoods(Set<Tgood> tgoods) {
		this.tgoods = tgoods;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tgoodtypes")
	public Set<Tgoodtypes> getTgoodtypeses() {
		return this.tgoodtypeses;
	}

	public void setTgoodtypeses(Set<Tgoodtypes> tgoodtypeses) {
		this.tgoodtypeses = tgoodtypeses;
	}

}